// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLShowHistoryStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "SQLExprTableSource.h"

SQLShowHistoryStatement::SQLShowHistoryStatement()
{
  properties = std::make_shared<std::list<SQLAssignItem_ptr>>();
  partitions = std::make_shared<std::list<SQLAssignItem_ptr>>();
}

SQLExprTableSource_ptr SQLShowHistoryStatement::getTable()
{
  return table;
}

void SQLShowHistoryStatement::setTable(SQLExprTableSource_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLShowHistoryStatement));
  }
  this->table = x;
}

// @Override
void SQLShowHistoryStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLShowHistoryStatement)))
  {
    if (table != nullptr)
    {
      table->accept(visitor);
    }
  }
}

BOOL_ptr SQLShowHistoryStatement::isTables()
{
  return tables;
}

void SQLShowHistoryStatement::setTables(BOOL_ptr tables)
{
  this->tables = tables;
}

SQLAssignItem_list_ptr SQLShowHistoryStatement::getProperties()
{
  return properties;
}

SQLAssignItem_list_ptr SQLShowHistoryStatement::getPartitions()
{
  return partitions;
}
